package com.dubbo.CarBalance.utils;

import com.dubbo.common.dtos.PageResponseResult;
import com.dubbo.model.balance.dtos.AccountAccessoriesDto;
import com.github.pagehelper.PageInfo;

public class PageUtils {

    /**
     * 将分页信息封装到统一的接口
     * @param pageRequest 
     * @param page
     * @return
     */
    public static PageResponseResult getPageResult(Object pageRequest, PageInfo<?> pageInfo) {
        PageResponseResult pageResult = new PageResponseResult();
        pageResult.setCurrentPage(pageInfo.getPages());
        pageResult.setSize(pageInfo.getSize());
        pageResult.setTotal((int)pageInfo.getTotal());
        pageResult.setData(pageInfo.getList());
        /*pageResult.setPageNum(pageInfo.getPageNum());
        pageResult.setPageSize(pageInfo.getPageSize());
        pageResult.setTotalSize(pageInfo.getTotal());
        pageResult.setTotalPages(pageInfo.getPages());
        pageResult.setContent(pageInfo.getList());*/
        return pageResult;
    }
}